<template>
    <div class="wrap height100">
        <div class="user_t">
            <div class="ts">
                <i><router-link to="/myInformation">
                    <img v-if="head_img" :src="head_img" width="100%">
                    <img v-if="!head_img" src="./../../assets/img/defoutAtho.png" width="100%">
                </router-link></i>
              <br>
                <!--<span>{{nick}}-->
                  <!--<br>ID：{{userid}}-->
                <!--</span>-->
            </div>
          <span>{{nick}}</span>
            <!--<div class="money_num">-->
                <!--<span>构树链总资产：{{alltotal | nubFixed}}</span>-->
                <!--<span>构树链可用资产：{{usetotal | nubFixed}}</span>-->
            <!--</div>-->
        </div>
        <!--<div class="user_bag">-->
            <!--<h2>我的钱包</h2>-->
            <!--<ul class="u_b">-->
                <!--<router-link to="/gsl" tag="li"><i class="fa fa-cc-visa fa-lg" aria-hidden="true"></i><span>构树链</span><b>{{alltotal | nubFixed}}</b></router-link>-->
                <!--<router-link to="/gsm" tag="li"><i class="fa fa-credit-card fa-lg" aria-hidden="true"></i><span>构树苗<b>{{sapling | nubFixed}}</b></span></router-link>-->
                <!--<router-link to="/integticket" tag="li"><i class="fa fa-cc-diners-club fa-lg" aria-hidden="true"></i><span>金券积分<b>{{f_point | nubFixed}}</b></span></router-link>-->
                <!--<router-link to="/shopingticket" tag="li"><i class="fa fa-ils fa-lg" aria-hidden="true"></i><span>购物积分<b>{{point | nubFixed}}</b></span></router-link>-->
            <!--</ul>-->
        <!--</div>-->
        <div class="user_bag">
            <h2>我的操作</h2>
            <ul class="u_b">
                <router-link to="/myInformation" tag="li"><i class="fa fa-user-o fa-lg" aria-hidden="true"></i><span>个人资料</span></router-link>
                <!--<router-link to="/lmyorder" tag="li"><i class="fa fa-retweet fa-lg" aria-hidden="true"></i><span>我的交易</span></router-link>-->
                <router-link to="/record" tag="li"><i class="fa fa-file-text-o fa-lg" aria-hidden="true"></i><span>我的订单</span></router-link>
                <!--<router-link to="/bankCard" tag="li"><i class="fa fa-credit-card fa-lg" aria-hidden="true"></i><span>支付方式</span></router-link>-->
                <!--<router-link to="/qrcode" tag="li"><i class="fa fa-share-alt fa-lg" aria-hidden="true"></i><span>分享</span></router-link>-->
                <router-link to="/setting" tag="li"><i class="fa fa-cog fa-lg" aria-hidden="true"></i><span>设置</span></router-link>
            </ul>
        </div>
        <tabbar :num ="num"></tabbar>
    </div>

</template>
<script>
    import tabbar from "./../../components/tabbar.vue"
    export default {
        data(){
            return {
                num: 2,
                head_img: '',   //头像
                nick: window.localStorage.getItem('nick'),
                userid: window.localStorage.getItem('user_id'),
                alltotal: 0,  // 构树链总资产
                usetotal: 0,  //构树链可用资产
                point: 0,  //购物积分
                sapling: 0,  //构树苗
                f_point: 0,  //金券积分
                phone:'',  //手机号
                refer_user_moble:''
            }
        },
		mounted(){
            this.initialize() //拉取信息
		},
		methods:{
            initialize(){
                let _this = this;
				this.Tools.AXIOS({
                    url: 'user/index',
                    success: function (res) {
                        let result = res.data.data
                        _this.alltotal =  parseInt(result.f_coin) + parseInt(result.coin);
                        _this.usetotal = parseInt(result.coin);
                        _this.point = parseInt(result.point);
                        _this.sapling = parseInt(result.sapling);
                        _this.f_point = parseInt(result.f_point);
                        _this.phone = result.moble;
                        _this.head_img = result.head_img;
                        _this.head_img = false;
                        window.localStorage.setItem('nick',result.nick_name);
                        window.localStorage.setItem('referid',result.refer_user_moble);
                    }
                })
            }
        },
		components: {
			tabbar
		},
    }
</script>
<style scoped>
.user_t{ width: 100%; padding: .6rem 0; display: flex; justify-content: space-between; background: #44B855;}
.user_t .ts{ width: 100%; display: flex; margin-top: .2rem;}
.user_t .money_num{ color: #fff; margin-right: .3rem;}
.user_t .money_num span{ display: block; text-align: right; font-size: .35rem; margin: .3rem 0;}
.user_t .ts i{ width: 1.3rem; height: 1.3rem; margin: auto; background: #fff; border-radius: 100px; display: block; overflow: hidden;}
.user_t .ts span{ font-size: .4rem; line-height: .65rem; color: #fff;}
.user_bag{ width: 100%;}
.user_bag h2{ width: 100%; font-size: .38rem; color: #404040; background: #fff; text-indent: .2rem; font-weight: normal; border-bottom: 8px solid #F6F6F6; padding: .3rem 0;}
.user_bag ul{ width: 100%; overflow: hidden; border-bottom: 8px solid #F6F6F6;}
.user_bag ul li{ width: 25%; text-align: center; background: #fff; line-height: 1.5rem; position: relative; padding: .5rem 0 .3rem; float: left; border-bottom: 1px solid #F4F4F4; border-right: 1px solid #F4F4F4; box-sizing: border-box;}
.user_bag ul li:nth-of-type(4n){ border-right: 0;}
.user_bag ul li i{ color: #FD9709; display: block;}
.user_bag ul li span{ font-size: .35rem; color: #404040;}
.user_bag ul li b{ font-weight: normal; font-size: .32rem; color: #FD9709; width: 100%; position: absolute; left: 0; bottom: -.2rem; text-align: center;}
</style>

